Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing Extensions and Drivers /
Chapter 4 - Printing Messages / Printing Messages Reference
Printing Messages / Raster Imaging Messages


GXRasterLineFeed

You can override the GXRasterLineFeed message to send the codes to a printing device that cause it to move the print head. Your override of the GXRasterLineFeed message must match the following formal declaration:

OSErr MyRasterLineFeed (short *lineFeedSize,
                        Ptr buffer, unsigned long *bufferPos,
                        gxRasterImageDataHdl imageData);
lineFeedSize
The amount by which to move the print head.
buffer
A pointer to the buffer for creating the line-feed sequence.
bufferPos
The location in the buffer to create the sequence.
imageData
A pointer to raster imaging-system-specific data. This structure is described in the section "Raster Imaging System Structure" beginning on page 4-23.
function result
An error code. The value noErr indicates that the operation was successful.
DESCRIPTION
QuickDraw GX, in its default implementation of the GXRasterDataIn message, sends the GXRasterLineFeed message to move the print head up or down the page. This message creates a sequence of characters for the device to move the print head up or down the page, by an amount specified in the lineFeedSize parameter. The sequence of characters needs to be placed in the buffer (specified in the bufferPos parameter) from the beginning of the pointer.

The default implementation of this message sends the line-feed in a format specified in the raster package control resource for your driver. It uses specific strings defined in that resource to control the process of generating the sequence of characters from the requested line-feed size.

You can override this message to provide your own translation from the line-feed size into the sequence of characters. You override of the GXRasterLineFeed message needs to translate the line-feed size into a sequence of characters, store this sequence in the buffer, decrement the line-feed size by the amount translated, and increment the location in the buffer by the number of bytes added to the buffer.

Note
The value of the line-feed size may be any integer value (negative, zero, or positive).
SPECIAL CONSIDERATIONS
You never send the GXRasterLineFeed message yourself.

You can totally override the GXRasterLineFeed message, or you can modify the data in some way and then forward the message.

If you use the default implementation of the GXRasterLineFeed message, you must define a raster package control ('ropt') resource.

RESULT CODES
gxSegmentLoadFailedErrA required code segment could not be found,
or there was not enough memory to load it.
gxPrUserAbortErrThe user has canceled printing.
SEE ALSO
You can find an example of an override of the GXRasterLineFeed message in
Listing 3-3 on page 3-19 in the chapter "Printer Drivers."

The raster package control resource is described on page 6-74 in the chapter "Printing Resources."

The GXRasterDataIn message is described on page 4-97.

The raster imaging system structure is described on page 4-23.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help